package com.execjar;

import lombok.extern.slf4j.Slf4j;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import org.joda.time.LocalTime;

import java.util.Date;

@Slf4j(topic = "p")
public class Demo {
    public static void main(String[] args) {
        DateTime now = DateTime.now();
        System.out.println(now);

        DateTime dateTime = now.withTime(LocalTime.MIDNIGHT);
        System.out.println(dateTime);

        DateTime dateTime1 = now.withTime(LocalTime.parse("23:59:59"));
        System.out.println(dateTime1);

        LocalDate localDate = now.toLocalDate();
        System.out.println(localDate);
        Date date = localDate.toDate();
        System.out.println(date);
        log.info("ssss[{}]", dateTime1);


        LocalDate localDate1 = now.toLocalDate();
        System.out.println(localDate1.withDayOfMonth(20));

        for (int i = 0; i < 10; i++) {
            log.info("ssss[{}]", LocalTime.now());
        }
        System.out.println(localDate1.withDayOfMonth(20));
    }
}
